{* $Id$ *}
{include_core file="admin/lib/header.html" title="商品分类添加/编辑"}
<div class="page-header border-bottom clearfix">
    <h2 class="left">商品分类添加/编辑</h2>
    <a href='{AnUrl("goods/admin/category")}' class="btn btn-default btn-sm right">&lt;&nbsp;返回商品分类列表</a>
</div>
<div class="add-form">
    <form class="js_creatForm" action="{AnUrl('goods/admin/category/save')}" method="post">
        <table class="table" cellpadding="0" cellspacing="0">
            <tr>
                <th><label class="add-f-label">分类名称：</label></th>
                <td>
                    <input autofocus="1" class="add-f-ipt1" name="data[title]" value="{$info.title}"/>
                    <input type="hidden" name="data[id]" value="{$info.id}"/>
                    <div class="tips"><span style="line-height: 34px;color: #f00;margin-right: 10px;">*</span>请填写分类名称
                    </div>
                </td>
            </tr>
            <tr>
                <th>&nbsp;</th>
                <td class="noborder">
                    <button type="submit" class="btn btn-success js_submit">
                        &nbsp;&nbsp;&nbsp;保存&nbsp;&nbsp;&nbsp;</button>
                </td>
            </tr>
        </table>
    </form>
</div>
<script>

    $('.js_creatForm').on('submit', function (e) {
        e.preventDefault();
        var form = $(this);
        var d = form.serializeArray();
        var data = [];
        for (var i = 0, len = d.length; i < len; i++) {
            data[d[i]['title']] = $.trim(d[i]['value']);
        }

        form.get(0).submit();
    });
</script>
{include_core file="admin/lib/footer.html"}